<?php
$dayList = array('nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota');
?>

<div id="user">
	<span>
		Ste prihlásený ako:
		<em>
			<?php echo $this->Html->link($actualUser['Person']['full_name'], array('controller' => 'user', 'action' => 'profile')); ?>
		</em>
	</span>
	
	<ul>
		<?php if (isset($calendarPopup)): ?>
		<li class="first popup">
			<a class="popup-source calendar" href="#">Kalendár</a>
			<div class="popup-target" style="display:none;">
				<p>Dnes je <?php echo $dayList[date('w')] . ' ' . date('j.n.Y'); ?></p><p>Meniny má: <?php echo $todayNameList; ?></p>
				<?php if ($calendarPopup): ?>
					<?php if ($soonBirthDayPersonList): ?>
					<h4 class="calendar_title">Najbližšie narodeniny:</h4>
					<?php foreach ($soonBirthDayPersonList as $person) {
					echo '<p>' . $person['Person']['birth_day'] . '. ' . $person['Person']['birth_month'] . '. ' . $person['Person']['full_name'] . ' ' . (date('Y') - $person['Person']['birth_year']) . ' rokov</p>';
					} ?>
					<?php endif; ?>
					<?php if ($soonNameDayPersonList): ?>
					<h4 class="calendar_title">Najbližšie meniny:</h4>
					<?php foreach ($soonNameDayPersonList as $person) {
					echo '<p>' . $nameDates[Inflector::slug($person['Person']['name'])]['day'] . '. ' . $nameDates[Inflector::slug($person['Person']['name'])]['month'] . '. ' . $person['Person']['full_name'] . '</p>';
					} ?>
					<?php endif; ?>
				<?php else: ?>
					<?php echo '<br /><p>Tento týždeň neoslavuje nikto</p><br />'; ?>
				<?php endif; ?>
			</div>
		</li>
		<?php endif; ?>
		<li<?php if (!isset($calendarPopup)) { echo ' class="first"'; } ?>>
			<?php echo $this->Html->link(__('Úprava profilu', true), array('controller' => 'user', 'action' => 'editProfile'), array('class' => 'first')); ?>
		</li>
	    <li>
	    	<?php echo $this->Html->link(__('Odhlásiť', true), array('controller' => 'user', 'action' => 'logout')); ?>
		</li>
	</ul>
</div>